これだとLCC C++非対応コンパイラで動作するけど、参照削ると動かん 
だから>>985の説は間違えてる。

//main.cpp
#include <windows.h>
extern "C" int WINAPI add(int &x,int &y){
int z;
z=x;x=y;y=z;
z=x+y;
return z; }

//main.def
LIBRARY DLL
EXPORTS
add

//test.c
#include<stdio.h>
#include<windows.h>
typedef int (WINAPI *fnc)(int&, int&);
main(){
HINSTANCE hd = LoadLibrary("dll.DLL");
fnc add = (fnc)GetProcAddress(hd,"add");
int a,b;
a=5; b=4;
printf("a+b=%d a=%d b=%d\n", add(a,b), a, b);
getchar(); }