You'll have to pass an additional argument, with the address of
the object to call the function on. Something like:
extern "C" void SendCommandToSerialDevice( void* object,
int command, int parameters, int deviceId )
{
static_cast( object)->sendCommandToSerialDevice(
command, parameters, deviceId );
}
main will, of course, have to find the instance of the class
somehow.
EDIT:
Concerning some points brought up in other answers:
In your example, you compile main as C. This is undefined
behavior, and in practice could mean that your constructors will
not be called on static objects. (If your code is in a DLL,
you're OK. The standard doesn't say anything about DLL's, but
in practice, they work.)
If you're reporting errors by means of exceptions, then
you'll have to change your signature to report them in some
other way, and wrap your code to catch all exceptions, and
convert them to the C convention. (Since your function has no
return value, this is easily handled by means of a return code.)