This guide will walk you through the process of creating a simple module using the Visual Studio 2010 DNN Template, this simple module can then be used as the starting point for creating you're own modules.
To get started you need to download the Visual Studio 2010 Template, simple unzip and install by double clicking the file package.
Creating your First Module
Select new project in VS2010, selecting the C# DNN Module Template.

Enter the name of the module in Name field
Location field should be the DesktopModules folders of your development install of DNN 4 or 5
Create directory for solution should be unchecked
Build the project to have Visual Studio create the dll for the module.
Log in to the portal as the Host user and from the Module Definitions menu select the Import Module Definition
Select the module dnn file from the Manifest dropdown list and click Import Manifest

From the Host menu select SQL and open the file 01.00.00.SqlDataProvider which is in the root of your module folder directory. Check Run as Script then Execute to create the database objects for the module.

Add the newly created module to page to test it out.

That is all there is to it, from here you can customise the code and database to make your own modules. This is exactly how I create all my modules on this site.