Hey,
Check out Professional InfoPath 2003 published by Wrox. They have a small section on buttons in the toolbar for added functionality to the form.
If you are merely looking to add a button on the form template, select the button from the controls and add it to your template. In the button properites, the "functionality" behind the button can either be done via rules or code. If you click on code, InfoPath will create the subroutine basics for you.
Hope that helps,
MB