CNC codes are composed of G codes represents preparatory function and M codes represents miscellaneous function, to generate CNC codes the software like MASTERCAM, NX CAM etc are used were the 3D model is imported to software and by providing cutting parameters like cutter type, size, feed, speed ,depth of cut etc the codes will be automatically generated in below link in my assignment Part-A may be helpful to you
There are two forms to make CNC programing: 1) manual and 2) automatic. For make the first people need to know the languaje of the CNC of the machine. Each CNC machine have a "Programing" manual.
The automatic programing is made with CAD-CAM programs. We take a geometry of CAD design, translate to CAM, and before use the routines inner of CAM for the differents types of machining.
First people study manual programing, before automatic.