First you must create a project in VS. Create folders for 12/template/features/webpartname/<here is where XML files go>
Next create code, best to create in new folder off root of project, webpartcode/webpartcodefile.cs
The feature and elements xml that must be created will reference the webpart.webpart file. That file will reference the actual class where all the work is being done.