How to verify a certificate using OCSP is presented in this question:
Verifying a certificate with Verisign OCSP Server
As OpenSSL is a C/C++ program/library you have to call it via command line from within Java if you want to use it.
However if you are on Java - why not verify it using the OCSP capabilities of Java (or to be specific of Sun/Oracle Java).
It is simply deactivated but can be activated with a few lines of code:
PKIXParameters params = new PKIXParameters(anchors);
// Activate certificate revocation checking
params.setRevocationEnabled(true);
// Activate OCSP
Security.setProperty("ocsp.enable", "true");
This code was taken from Xuelei Fan's Blog. It also shows an example how to actually verify a certificate:
http://blogs.oracle.com/xuelei/entry/enable_ocsp_checking