Are there any free/open source alternatives to Codesmith that would be comparable in features and generate .NET code?
Depending on your needs, Visual Studio's T4 (Text Template Transformation Toolkit) might be worth a look. Check out Scott Hanselman's article for an introduction.