Sample code for 30+ languages & platforms
Perl

PKCS11 Examples for Chilkat2 Perl