For a document template, the userform and the macro that drives it should go in the document template and not the normal template. However it can work for any document in the normal template.
The simple userform example from the link contains all the code relating to the userform, however, as mentioned on the linked page, you need to to call the form from the document/template. This is done from a simple macro in a project module.
http://www.gmayor.com/installing_macro.htm
Option Explicit
Sub ShowMyForm()
UserForm1.Show
Unload UserForm1
End Sub
If you want the form to display automatically when you create new documents from the template, create an autonew macro
in the template to call the above macro e.g.
Sub AutoNew()
ShowMyForm
End Sub
This however relates to document templates only as you don't want the form popping up every time you create a document from the normal template