There are multiple ways to do this, and it really depends the code you want to import.
I'm going to assume your on Windows, since you mentioned C# and VB.
If the code you want to import is in a .dll file, you should have a header file, and a .lib file. For example, this allows you to use pretty much any Windows function.
CODE
#include <windows.h> // Includes the prototype of the functions to import
int main(void)
{
while(!GetAsyncKeyState(VK_ESCAPE))
Sleep(10);
return 0;
}
To compile the above you, don't actually have to do anything special. A lot of Windows functions will require you to add a stub library (basically tells the compiler how to import the functions from the .dll).
If you use any of the GDI+ functions, you'll have to add gdi32.lib. OpenGl, opengl32.lib. Some specific kernel functions, user32.lib.
To add a library, if you are running from the command line, you simply just add the library to the compilation string.
For GDIs, you have to add it to the linker list, which differs based on IDE you are useing.
For Visual Studio, the simple way to add one is to go to
Project -> <Project Name> Properties -> Linker -> Input -> and add your .lib files to "Additional Dependencies"
You can also use
LoadLibrary() and
GetProcAddress(), but that is a lot more complected, and I don't really want to get into that.