Sample code for 30+ languages & platforms
CkJava

PKCS11 Examples for CkJava