I think if you want to make one or two custom gears, you just manually mill them. CNC involves the usual programming tradeoffs -- you spend a ton of time writing and debugging the program, and then you can run the program a million times to make a million parts. For making one part, it's not clear that it's worth the overhead -- just set up your stock on a dividing plate and use a gear cutting tool to cut the teeth. If when you're turning the handwheels the machine makes an unpleasant noise or it feels like you're going to break the tool, stop turning the handwheels and use your brain's built in AI algorithm to develop a new plan ;)