I got better results using the Realtimestylus API instead of wintab. Because wintab doesn't seem to return packets frequent enough for smooth lines when drawing.
The windows RTS API gave me more information packets, thus smoother results when drawing, and also more pen information can be accessed such as tilt and pen button presses.
there's a nice small demo app using RealTimeStylus with SDL:
https://backworlds.com/under-pressure/
It includes comments in the implementation, where it explains how to access raw tablet input.
The sample code contains an eventhandler class derived from the interface class IStylusSyncPlugin from rtscom.h.
With this interface you can register pen and touch events using STDMETHODS, for example: STDMETHOD(StylusButtonDown){}.
To get the actual pen position in screen coordinates is a bit difficult. As you first need to get the x,y coordinates as packets, using STDMETHOD(Packets). You will also need to describe which packets you want to receive and in what order using: IRealTimeStylus::GetPacketDescriptionData().
Lastly you need to convert the X, Y input into screen-coordinates depending on the dpi,
using Gdiplus::Graphics::GetDpiX()
X = dpiX * (float)pLastPacket[g_lContexts[iCtx].x] / 2540;
Y = dpiY * (float)pLastPacket[g_lContexts[iCtx].y] / 2540;
All this is provided in the example code by Anders Ekermo.
Hope it helps.