This add-on makes it a lot easier and provides a GUI:
https://xenforo.com/community/resources/content-type-management.2513/
The rough process, though, is:
- Record in xf_content_type for the content type
- Record/s in xf_content_type_field to define what the handler is, what it does and its class
- Queries during add-on install to insert those content types in the database
- Queries during add-on uninstall to remove those content types (and the content they generate) from the database