It is a little dangerous to learn to write CNC programs before you are familiar with NC programming.
Are you familiar with G-Codes (for example,
http://www.carbidedepot.com/formulas-gcodes.htm)
which can differ from one machine to the other.
Then you may want to be familiar with the kind of machines you'd be working with, 3-axis milling, lathes, 5-axis, EDM, etc.
In general, there are modules of CAD programs that generate machine codes according to a post-processor customized for the machine you would be using.
If you are not familiar with any of the above, the best way is to look for appropriate courses in community colleges. If you are already employed in the field, your employer will probably be overjoyed to send you to various courses.
As you mentioned, you are working with problems in a course, you would probably be best positioned to search for the answer to the particular problem you have in mind, or your teacher should be able to guide you.