Is there an AI system that automatically generates classes and methods by giving it voice commands?
While you can use NLTK for analyzing and parsing the text obtained from the speech to text interface (e.g. Siri), there are higher level APIs available for this. The class of problem you are trying to solve in NLP is "intent detection". 

There are several open source and commerical APIs available for this including Amazon Alexa, Google Cloud Natural Language, Azure, as well as libraries like RASA NLU, etc.

The high level flow of your program will be:


Record/receive spoken audio
Convert audio speech to text
Detect intent of the text command using an intent detection library
Use the intent to feed a script/automation that generates the code in your IDE