Just DLL import the OpenSSL functions from OpenSSL's libeay32.dll, it's much easier than coding your own in my opinion (although that's what I did, haha).

Edit:
Check Korvacs' wiki as well, it documents it using the OpenSSL functions which seem DLL imported.