You can certainly use (or call) a C function from a class method, you just can’t import a DPI C function from within a class. You can only import a C function or task from a point where you would be allowed to declare a function or task that is not a method of a class.
The reason for this restriction is that class methods have an implicit this argument set with the handle of the class object calling the method. That handle represents the “context” of the method. Non-class functions or tasks have no such context.
So your class method should be able to call a C function just like any other non-class function as long as the function name is visible from the scope where the class is defined.
You can certainly pass strings through the DPI as well as convert bytes (or an array of bytes) to a string using a cast. Just remember that a string cannot contain the ‘\0’ (null) character.