You can take
Diagram Editor[
^] as an example and extend its functionality based on the provided base classes
Or DrawCLI sample (in Visual Studio Samples Pack) can be another example as a startup project
But these two projects are based on MFC ,if use of MFC is a problem then you can easily port
Diagram Editor to Win32
For hit testing on irregular shapes i would recommend to use of GDI+ instead of GDI