How to implement CVariable for custom classes

I develop a shared library in Kotlin that will be include in a C++ application.

in Kotlin I have some classes, that i use as data exchange objects between C and Kotlin.

For these classes I want to inherit from a CVariable or CStructVar to work easier with pointers. For example to exchange an array with pointers between Kotlin and C. Is this possible?

Here I have a simple example:

class MyStruct(var a: Int, var b: Double) : CVariable(nativePtr = ?)

Best regards