I don't know if this is still helpful, but I encountered this problem too so it might be helpful to others new to the IDE and computing in general.
I first downloaded the OpenCV libraries onto raspberry pi via SSH following this tutorial - https://docs.opencv.org/3.4/d7/d9f/tutorial_linux_install.html
Then on the right hand side of the visual studio interface, I right click on the solution explorer and clicked properties at the very bottom.
from there, go Linker->Input->Library Dependencies.
In the box, paste:
eg. if you want to use the wiring pi library (After installing on the raspberry pi FIRST), you add 'wiringPi;' to the end of that string above.
click ok, then you're done.
The libraries can be 'accessed' with:
#include <opencv2/core(or whatever other name).hpp>
I encountered a problem where the opencv2 folder was nested in opencv4, the directory therefore was on my pi - usr/local/include/opencv4/opencv2/…
however, because in the 'sub' libraries of OpenCV, they include other libraries with the directory of opencv2/… , and not opencv4/opencv2/… so there were errors. So I moved the folder opencv2 to the usr/local/include directory and deleted opencv4 directory. And now it works.
I don't know if the problem is isolated to me (I made mistake while installing) or it may occur to you.
Hope this helps!