Do you know if there is a C library to handle FMU and run simulations including a good solver?
As far as I know there are:
Both can open FMUs, but only let running FMU for co-simulation with a simple Euler solver.
Libraries including a good solver handling discontinuities, but not in C, are:
I don't think the FMUSDK is really maintained, so the FMI Library is probably the better choice between those two.
To improve the solver, you'd probably have to pair the FMI Library with a solver like Sundials and figure out how to stitch those two together. Note, this is exactly what Modelon has done with the PyFMI library. While it is a Python library, I suspect you could probably find a relatively easy way to integrate into a non-Python project as long as you were able to use C code to integrate them (which apparently you are).
I suspect calling PyFMI from C is going to be easier than stitching FMIL together with Sundials on your own.