Hi N yx,
Since you already performed most of the troubleshooting steps to fix the pen, it might not be software related anymore. I suggest that you run and install the Microsoft easy fix solution for devices and hardware on this link.
If the issue still persists, I suggest that you test the pen and tablet on another computer and check if it functions there. There is also the possibility that it's the USB port itself as well. You can refer to your hardware manufacturer's manual for diagnostic tools you can use for identifying hardware issues.
Regards.