You didn't give exact details, so this is a guess based on your info. You can find an example here. I'll quote (and simplify) the relevant parts:
// C/C++
int ncWrite(unsigned long DataSize, void* DataPtr)
// C#
[DllImport("Nican.dll")]
unsafe static extern int ncWrite(uint DataSize, byte[] DataPtr);
byte[] DataWrite = {0x23, 0x23, 0x30, 0x03, 0x78, 0xEC, 0xFF, 0xFF };
int status = ncWrite(Marshal.SizeOf(DataWrite), DataWrite);
EDIT: With your info:
// .ocx
Public Function WriteData(ByVal devIndex As Long, ByVal lpOutData As Long, ByVal cntData As Long) As Long
// C#
[DllImport("TheOcxControl.dll")]
static extern int WriteData(int index, byte[] outputData, int outputDataLength);
byte[] DataToWrite = {0x23, 0x23, 0x30, 0x03, 0x78, 0xEC, 0xFF, 0xFF };
int status = WriteData(index, DataToWrite, Marshal.SizeOf(DataToWrite));
As for the arrival event:
// the e variable have devIndex, lenDataBufer, lpDataBufer properties.
// lenDataBufer is size of buffer, lpDataBufer is pointer to data array.
byte[] destination;
Marshal.Copy(lpDataBufer, destination, 0, lenDataBufer);