If you try and create and instance and it is not available you will get an error - check @ERROR for the reason code.

You could also read the registry directly to see if it has been registered, but it is usually simpler just to try and create the instance.

Could you be a little more specific about what you are trying to do?