Is it possible to turn an Android phone into a USB gamepad for the PC? If yes, how?
Have you tried searching for
gamepad in Google Play?
Here are some of the results:
Connect through wifi or bluetooth in the most simple way. Install the Ultimate Control Receiver program on your computer (PC, Mac or Linux) and select it from the list displayed on your phone.
DroidPad lets you use your phone as a PC joystick or mouse.
There's a $43 USB device, InputStick, that will do the trick. I bought this a few months ago for password entry from KeePass on Android, but the developer created the USB adapter so your android device can act as any conceivable USB device. Your android device connects to the USB dongle via bluetooth, and the desktop computer sees the USB dongle as any profile you choose.
The gamepad profile is built-in. From the description, it can emulate 4 axis and 16 buttons built-in, with the ability to customize as well.