You can define content classes in the admin interface. You won't have to write any code for this. See http://ez.no/doc/ez_publish/technical_manual/3_6/concepts_and_basics/content_management/the_content_class
Documentation on how to write your own extension can be found in the old documentation section ( http://ez.no/products/ez_publish/documentation/development ) or the eZ publish book ( http://ez.no/products/books/ez_publish_book ).