After you have downloaded and installed the freeware version of CodeSmith and downloaded and unzipped the UPDATED & ENHANCED templates, you'll need to import the templates into CodeSmith.
Click the Browse for Folder icon and navigate to the folder where you have unzipped the CodeSmith templates and hit OK. A folder will be created for you in CodeSmith and named based upon the template holding folder. You can right click on the folder node to rename it whatever you want.

To create the Controller Classes you'll need for custom module, double click on the Controller Class template. A new screen will open up as shown below. Click on the ellipses in the Source Table row to create a connection to your database where the tables for your module can be found.
In the Table Picker Screen, again click on the ellipses to create a connection to your database.
Click on OK and it will be displayed in your list of current connections. Once you see your connection in the window, hit Close and your database tables will be displayed to you.
Select a table that you want to create a controller class for and either double click or highlight and click Select. Then fill in the options on the Generator Screen and don't forget to update your namespace or you'll have to modify each class by hand. After you are satisfied with your options, click the Generate button on the bottom and you're generated code will be displayed to you in the right hand side of the window.
Click the Save icon and name your new file accordingly...and don't forget to save with the ".vb" extension.
Now, you can repeat the process with the Info Template. Then, to top it all off, you can run the Sql Stored Procedures template and CodeSmith will create the SQL file that you can distribute with your module. The template will even generate the file using the {databaseOwner}{moduleQualifier} tokens required. That's it!
Download Related Files Here or on the Downloads page:
DNN 4.x Templates Download