How can I add support for tablet drawing to my projects? What I mean is that most pen tablets have the functionality of acting as "normal" pointing devices when held regularly, but when the pen is flipped, it acts as an eraser (OneNote works this way, for example).
How can I detect which side of the pen is being used?
I would follow the native API of your tablet. Your tablet's vendor has very well described SDK including several examples
(in Visual C++).
What you are specifically looking for is the eraser detection