This c++ code solves the IK for the UR5 model and via connecting Visual Studio with V-rep, creates a simulation.
User must download the Eigen library from the provided website. http://eigen.tuxfamily.org/index.php?title=Main_Page
Here is a short demonstration video.
https://www.youtube.com/watch?v=DBytXPBmm-Y&feature=youtu.be