How to create a module with forms?
One of the best way to learn how to do develop various common tasks is with Examples module.

Check especially the form_example module which has all necessary instructions and code examples.