I have identified two methods to convert SharePoint 2007 code to SharePoint 2010 using Visual Studio 2010 but sometimes it might not work 100% based on the complexity of your solution and how good you designed your previous solutions. But one thing i am sure that it will make your life easy rather building the solution from scratch.
1) Import SharePoint Solution Package or WSP
Open Visual Studio 2010, Click on File -> New Project and it will open "New Project" Dialog box as shown below. From the list of Installed templates select SharePoint on the left side of navigation and select "Import SharePoint solution package" as shown below ,
1) Provide the solution name and click OK
2) then provide debugging information such as SharePoint Site, Trust level (sandboxed or full-trust solution)
3) After that it will ask for WSP to import from. So please browse for the WSP you want to convert and then visual studio will automatically convert the solution and will display the converted project.
2) Import WSPBuilder Project (if its not visible please download here)
Open Visual Studio 2010, Click on File -> New Project and it will open "New Project" Dialog box as shown below. From the list of Installed templates select SharePoint on the left side of navigation and select "Import WSPBuilder Project" as shown below ,
1) Provide the solution name and click OK
2) then provide debugging information such as SharePoint Site, Trust level (sandboxed or full-trust solution) and also the path of the existing WSPBuilder Project.
3) once you have given all the information click on Finish and then visual studio will automatically convert the solution and will display the converted project.
You have to verify thoroughly all the features and add the missing features.
Hope it works !!