One way, though not very sophisticated, is to try opening each COMn port, and then request the device ID, until you find the right one.

I have used this method in some of my programs, and it works fairly well, although XP will sometimes give a fault for reasons I never discovered.