First of all you will need a Development Environment with SharePoint 2010 and Visual Studio 2010.
Download and install SharePoint 2010 SDK.
Download and install Visual Studio 2010 SharePoint Power Tools.
Then you have to enable Microsoft SharePoint Foundation Sandboxed Code Service in Central Administration. Go to Central Administration and then click Manage services on server.