As an example say you have a class called Shape and you have a function CalculateArea. Not all shapes will calculate the area in the same way so in your base class you would;
class Shape
{
public:
virtual double CalculateArea() { width * height; }
}
Then in your derived class you would;
class Circle : Shape
{
public:
virtual double CalculateArea() { pi * radius * radius; }
}
You only make functions virtual where it makes sense.