Yes, you can use the public key as byte[] to encrypt some text by using a PublicKey object.
You should create a public key session object (I mean not a token object stored in the token) and use it to encrypt.
You can use the Create method passing a template for a public key by setting CKA_TOKEN attribute to false