I did a quick search and came up with the following link. On the page is a description and the link to download "joystick.exe" which has what you need including sample code.
SUMMARY
Joystick.exe is a self-extracting compressed file containing a sample project that demonstrates how to use the Joystick API functions in Visual Basic. You can use this sample as a starting point for a game program that uses a joystick for an input device.
__________________
Sometimes my thoughts are in a degree of order so high even I don't get it...
If you are trying to use a joystick you are doing an input to a computer and a PWM might be an output and can be done with an external interfase. In order to help you please let me know if my appreciation is correct.
Regards.
I have already done this with an Atmega 128 chip and now I want to do the same with a PC laptop, preferably with a touch screen so that I can pre-program functions into the touch screen or operate the pwm with a joystick if used that way. My project is pretty much like a security camera console, only windows based and preferably visual basic programming since I already know that language.
FYI, there already is available a USB PWM device, is just was not sure of how to access a joystick. Looks like there are API calls already done in a DLL.