You need to install the OS version on your PC, the same one you wish to use on your device.
Install Desktop Manager, and connect your device and load it up.
The following steps assume that you already have the operating system installed to your computer. If you do not, please download and install the OS to your computer to ensure that you are installing a clean version to your phone. To download the OS, go to your carrier's download site, available here: BlackBerry - BlackBerry Desktop and Device Software Download Sites
Before you do anything, back up your BlackBerry device. Open the BlackBerry Desktop Manager and select Backup and Restore. On the next screen select Backup and perform a full backup of your device data. Note where the backup file is located (usually in the Documents folder). Close the BlackBerry Desktop Manager and leave your device plugged in.
Open Windows Explorer and go to the following folder: C:\Program Files\Common Files\Research In Motion\AppLoader\ and open the Loader.exe file. In Vista 64-bit computers, the file is in C:\Program Files (x86)\Common Files\Research In Motion\AppLoader. Depending on your computer's settings, you may need to show hidden folders (under File > Options for Windows XP or Organize > Folder and Search Options in Windows Vista).
After the device configuration has been retrieved, you will be on the Device Application Selection page. You may scroll through the list to ensure all the applications you want are selected. You can also de-select any applications you don't use to save space. Click Next.
On the next page, click on the Advanced button. Ensure that both boxes (Delete all application data and Delete all currently installed applications) are checked. Click Next.
Proceed with the OS reinstall. Note that this process may take 10-30 minutes (usually ~10 minutes). Do not disconnect the device.
Once the process is complete, re-open the BlackBerry Desktop Manager. Select Backup and Restore and open the Restore application. Select the file to restore (Backup-(Year-Month-Day).ipd) and click open. Follow the steps to restore your device.
Re-enable your device connection by going to Manage Connections and turn on your Mobile Network. Re-download any missing applications and re-connect to any BlueTooth devices and you're done.
That's it. You should now be back up and running. Note that this process will delete all your third party applications, hence why you need to redownload any missing applications. I also recommend pulling your battery out for 15-30 seconds after this process is complete to ensure the device is running smooth. Should take about 30-45 minutes to complete.