Code:
[StructLayout (LayoutKind.Sequential)]
class Parameters { public double a, b, c; }
That should be

Code:
[StructLayout (LayoutKind.Sequential)]
struct Parameters { public double a, b, c; }
Code:
double quadratic (double x, void *par)
Assuming the "void* par" part refers to a Parameters type, you can safely change this to:

Code:
double quadratic (double x, ref Parameters par)

// called like:
Parameters p = new Parameters { a = 1, b = 2, c = 3};
quadratic (5, ref p);
Code:
 double average (Func f, IntPtr p, double a, double b, int n);
This can be rewritten to use ref Parameters instead of IntPtr aswell.

That should help.