To develop a user-level consumer, a developer needs to keep the following items in mind:
Include <security/cryptoki.h>.
Make all calls through the PKCS #11 interfaces only.
Link with libpkcs11.so.
Libraries should not call the C_Finalize() function.
See Chapter 9, Writing User-Level Cryptographic Applications and Providers for more information.