As per my understanding, you want the USB block in PSoC device act as a mouse or keyboard. If it is so, you can follow up this code example here : CE226423 - PSoC 6 MCU: USB HID Mouse Application (cypress.com) . This code example demonstrates how to setup a USB HID descriptor to implement a 3-button mouse. After the device enumerates, firmware moves the mouse cursor from your computer from the right to the left, and vice-versa. It will help you understand the code implementation for the mouse functionality. However, we do not have such a code example for key board function using USB . I would suggest you to develop your own project where USB device can act a mouse or keyboard after taking help from the above code example.
Also, Please let us know here in case of further queries.