Use this PowerShell script to uninstall and remove all the custom solutions
From http://sharepoint247.wordpress.com/2013/04/09/powershell-script-to-remove-all-custom-solutions-from-sharepoint-farm-solutions-store/