I you are certain you won't touch the variables that are used for the sorting the you could work around this by using a const_cast like this:
MyClass tmpClass;
std::set<MyClass > setMyClass;
setMyClass.insert(tmpClass);
std::set<MyClass >::iterator iter;
iter=setMyClass.begin();
const MyClass &tmpClass2=*iter;
MyClass &tmpClass3 = const_cast<MyClass&>(tmpClass2);
Alternatively, you could declare the members of the class that you intend to change as mutable.