Device Manager and right click the device. Windows will show you the VID and PID of the device so you can compare.

But the above seems incorrect.

What are you trying to do exactly? If it's to notice when a device is inserted or removed, there is buildin APIs for this and you will then get a message telling you when a device is inserted or removed - no need to do it yourself. Eg. Look at WM_DEVICECHANGE