Sorry to disappoint you, but what you want can not be done with a PIC18F2550.
Starting at the beginning, there are three types of USB devices:
1) USB Host, examples: computer, media player. These devices have a USB type A socket.
2) USB Slave, examples: keyboards, mouse, USB flash drive, USB disk drive. These devices have a USB type A plug, USB type B socket or mini/micro USB connector.
3) USB On-The-Go, examples: some mobile phones. For more information see
this explanation
For USB to work you have to connect a USB Slave to a USB Host.
The Flowcode for PIC USB components (including the HID component you are using) are for slave devices. The keyboard is a slave device. So you are trying to have a slave device talk to a slave device, that will not work without a master like a computer in between.