I'm considering invoking a C function from an OCaml generic function and pass in a generic value as a parameter to the C function. Is it possible? If yes, how can the C function know the type of the parameter value?
Types don't exist at runtime in OCaml.
It is possible to pass a polymorphic value to a C function, but outside of peeking at the memory representation of the value (which is what the polymorphic comparison, hash and equality functions are doing under the hood), you cannot do anything with this value.
This is the main difference between parametric polymorphism and generic/template functions: the behavior of parametric polymorphic functions never depends on the particular type of their argument.