This video tutorial will show you how to write a DLL for MT4 step by step. this example covers sending an instrument's data to a dll, calculate a basic moving average and send the moving average array back to mt4.
Also available are the source code for both VS 2008 and Dev-C++.