Works pretty much the same... it seems to me that what you need is a better understanding of the basics of using classes in C++.
This provides a good introduction: http://cplusplus.com/doc/tutorial/classes/
virtual is used to indicate that a member function can be overridden in a child class.
More on that here: http://cplusplus.com/doc/tutorial/polymorphism/#virtual