Hi Keith
Please download sdk for frdm-k66 from nxp website.
Welcome | MCUXpresso SDK Builder
unzip the package, there are two demos for your requirement.
FRDM-K66F_2.4.0_0605\boards\frdmk66f\usb_examples\usb_pin_detect_hid_msd\freertos
when you connect k66 with your PC, k66 work as a msd device.
when you connect a mouse with K66, it will act as a hid host
Please also refer to this demo,
FRDM-K66F_2.4.0_0605\boards\frdmk66f\usb_examples\usb_pin_detect_hid_mouse\freertos
Regards
Daniel