Вы можете просто добавить свои комментарии в начале файла, чтобы они выглядели так:
//----------------------------------------------------------------------------
// My comments
// Are go here
//----------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//----------------------------------------------------------------------------
Непосредственно перед генерацией CompileUnit для TextWriter выполните:
CSharpCodeProvider provider = new CSharpCodeProvider();
var tw = new IndentedTextWriter(new StreamWriter(filename, false), " ");
tw.WriteLine("//----------------------------------------------------------------------------");
tw.WriteLine("// My comments");
tw.WriteLine("// Are go here");
provider.GenerateCodeFromCompileUnit(compileUnit, tw, new CodeGeneratorOptions());