Drupal 6 - How to programatically create a content type
You can use the Features module to export out the content type and the fields associated with it. Once you have done this you will have a .tar or .zip file of the export code in a functional module.

From here you are able to move that directory into your sites/all/modules directory and have a fully functional module.

Do remember to remove your content type and fields, before installing the module on your site. The new module will recreate them for you.