For a new company project, one requirement was a bootloader that allowed USB connection with drag/drop of a text file (easy to transfer by email/etc); I found AN4379 but that seemed to be quite old and not suitable for the K22F Kinetis processor we had chosen.
I therefore wrote my own, slightly based on / inspired by AN4379; I started from the MSD RAMDISK example to give a USB framework, and then integrated code to provide the USB drag/drop feature.
I have an "archive" zip file but I'm not sure if it's ok to submit the finished code here ... I've attached one file which is the "heart" of the code, that processes incoming USB data packets to parse the S19 file and write it to processor flash memory.
USB MSC download only supports SB file drag-and-drop. You can use ELFTOSB tool to convert SREC file to .sb file.
Yes, AN4379 is old. But you needn't do it by yourself. The bootloader project in FRDM-K22F SDK v2.9.0 support USB-MSC function. You can enable it by change BL_CONFIG_USB_MSC definition to 1 in bootloader_config.h.