I don't know if this is the way to go

I have Dictionary<Class, int>
the int value - counts how many of that Class is stored there
I have a method that does that

Code:
        public void DictionaryAddClass(Class Class)
        {
            if (Dictionary.ContainsKey(Class))
            {
                int value = Dictionary[Class];
                value++;
                Dictionary[Class] = value;
            }
            else
            {
                Dictionary.Add(Class, 1);
            }
        }
so if we did this
Code:
            Class myclass = new Class ("AClass");
            DictionaryAddClass(myclass );
            DictionaryAddClass(myclass );
            DictionaryAddClass(myclass );
the value of that Key would be 3

Here is the probliem - I learned that if somewhere else I create a new class
Class myclass = new Class ("AClass");
even with the same parameters it treats it as a new Key
and this > if (Dictionary.ContainsKey(Class))
will not be true

I need to hold a number of these Classes in some kind of Inventory and store how many I have. Should I be using Dictionary or doing something else?