are there any classes in the .net framework that allow me to generate classes that i can save as .cs or .vb files ?
See the System.CodeDom namespace. Basically you use CodeDom to create an abstract model of the class. Then you instantiate a CSharpCodeProvider or VBCodeProvider and use one of the CodeDomProvider.GenerateCodeFrom... methods to emit it as the appropriate kind of source code. This is the underlying technology used by the Windows Forms Designer, xsd.exe, etc.
Be warned, however, that CodeDom is quite verbose and fiddly to work with. If your classes a moderately complex, you may want to use a templating engine such as T4 or NVelocity instead.
Do you really need specific .NET classes, or can you live with an addin to Visual Studio??
If you have Visual Studio, definitely check out the T4 template - one of the least known and yet most valuable assets in VS!
- T4 (Text Template Transformation Toolkit) Code Generation - Best Kept Visual Studio Secret
- Visual Studio's T4 Code Generation
- T4 Architecture and anything else on Oleg's excellent blog/website on T4
- T4: Text Template Transformation Toolkit
There's at least a command-line tool that you could call from .NET code to do the transformation, but I'm pretty sure you could also invoke some transformation engine as a .NET class and have it generate C# or VB.NET code from your T4 template programmatically.
Typically, using T4 is a lot easier than CodeDom - it has its limits, but for the most part, it's a great technology to get things done fast and easy.