It might be worth checking if another MIDI aware program (other than Sonar) can actually open the USB MIDI ports. If it can't, then try re-installing your USB driver.
I've also become victim to the MIDI port order issue, although in my case I noticed it by my MIDI keyboard not working (the control surface was using the keyboard's MIDI device rather than the MCU's), so it's best to check this isn't happening. When this happens, I've found you have to remove the control surface within Sonar and add it again, as just changing the device back to what it should be didn't work for me.
Incidently, the reason my MIDI ports were in a different order was due to me plugging in the MIDI interface after I'd booted up. When doing a clean boot of Windows with everything plugged in, I've not had any MIDI port order issues.
Another thing to check perhaps is your power settings - you should disable any powering-off of USB devices.