You can try GSL (GNU Scientific Library), which has a BDF solver implementation. In order to convert matlab code into C/C++ you need to have Matlab Coder extension.
I don't know what is the complexity of the problem you want to solve, but how about rewriting your set of ODE GSL. It's not a big deal. You just have to give the equations, and in case of some solvers the Jacobian of the system.
There are books on the solvers algorithms (ex. Numerical Recipies in C), or you can have a look on how it is implemented in GSL. The question is do you really need to write your own implementation of BDF solver? In most of the cases it is like reinventing wheel, unless you have a very specific system of ODE to solve.
I tried to solve those differential equations using mathematical methods , but it is giving nan values in the output , i tried to use c++ odeint library but graphs are not matching with my matlab values.