can anyone please provide steps to follow for migratng custom web parts which has code based .wsp file form sharepoint 2007 to sharepoint 2010.Thanks in advance
In a lot of cases it'll just work, but you might want to take a look at the series: Porting a SharePoint 2007 WSPBuilder solution to SharePoint 2010
It will depend on many things such as "are these 3rd party products?" - try to find newest versions (if exists and license allows you to), otherwise try to just re-install them on 2010. You need also to ask whether you plan to add/update more functionality? - if yes and you have the option, then you should probably invest in actual migrating the code to benefit from the new .NET 3.5 features, new improved API, etc.
Many tools existed at the time (WSPBuilder being most used to create .WSP packages), StSDev or even Visual Studio Extensions for WSS by Microsoft, make sure you choose an appropriate path to migrate. Visual Studio 2010 replaces the need for any of those tools now (e.g. support automatic import from a solution based on VSE for WSS).
You need to assess a little, we only highlight options and recommendations.