While I don’t know any sample code with OpenGL calls that does what you want, I think I can offer some information.

Since you said “Interpolation”, instead of “Approximation”, that means you want a curve that pass through all the points. Also you should have an ordered set of points, P_i, where i=1,…,n, and the curve starts from P_1, pass through P_2, P_3,…and ends at P_n. Otherwise, you may sort the points based on their projections onto a curve or axis.

Except in some very special cases, setting the input points to be the control points will NOT make the NURB curve pass through the input points. There is book titled : “The NURBS Book” written by Piegl and Tiller has a lot of mathematical descriptions about interpolation and approximation.