A buddy of mine pointed me to a great article on writing cool CodeSmith templates:
http://msdn.microsoft.com/library/en-us/dnhcvs04/html/vs04e5.asp

The author does a great job of covering the basics, and then gets into more complicated issues such as sub templates and custom property editors (like for picking a file using an OpenFile dialog box instead of requiring the user to type in the path to a file).

Very cool read.