How do I programatically attach fields to a node defined in hook_node_info()
If you have familiarize with features module. It will be easy. You can get more idea about content type creation and it is related with field. Follow the steps to get a working example. 


Create content type and related field in you site.
Enable features module and export this content type as a new module.
The system generated module, you can find the content type creation and field relateion code.
You can find documentation for creating content type and field via code in drupal.