jint size = 1; //your choice
jint vmCount;
JavaVM *jvm;
jint ret= JNI_GetCreatedJavaVMs(&jvm, size, &vmCount);
//if ret==0, it's a success
Make sure you add jvm.lib as an additonal dependency in linker properties and the path to jvm.lib in additonal library directory.
Rest of the information can be found on sun's documenataion.
http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/invocation.html