Q:

Void pointer as function parameter

I use two structures emulate "OR" & "AND" logic gates. These structures are the  same. I need to create a function which get as parameter one of these two structures. Something like :
int myfunc(void *mystruct, unsigned char param)
{
switch (param)
{
case 'o': ... break; //"OR" logic gate struct
case 'a': ... break; //"AND" logic gate struct
}
} 

How to realize this idea in managed code c++/cli?

A:

You can just use a union for your two different structs and then pass the union:
struct AND_gate {
    // ...
};

struct OR_gate {
    // ...
};

union gate {
    AND_gate and_gate;
    OR_gate or_gate;
};

int myfunc(gate * my_gate, unsigned char param)
{
    // ...
}

Alternatively, and perhaps better (hard to tell with the limited information available), it sounds like your design might benefit from using inheritance:
struct gate {    // parent class
    // ...
};

struct AND_gate: public gate {
    // ...
};

struct OR_gate: public gate {
    // ...
};

int myfunc(gate * my_gate, unsigned char param)
{
    // ...
}

