public ref class testaaa
public : int add(const test2bb & test2bbobj,int b);
That way the test2bb object is not copied but the 'add' method is working with the original object passed to the function. This is called 'const reference'. The way you did may induce copying of the object and this creates impact on performance. Also when you use const reference or even not const reference you don't need to implement operator == () because the object is not copied. If the object is simple and does not contain heap members, the compiler generated hidden operator == does the job, but if your class is more complicated it won't be copied at whole.
If you need to modify members of the passed object than you have to remove the 'const' keyword. In some conventions if the object can be modified in the function a pointer is preffered.
Also you need to check your namespaces. Maybe you need to add the namespace::test2bb in the function declaration.