PIC USB host and device
As long as the PIC you are using has an "On-The-Go" port (for instance, all PIC32 chips with USB are On-The-Go) then what you are proposing is feasible.

The USB port provides a pin called "USBID".  On USB Micro AB ports there are 5 pins. Pin 4 is the USBID pin (between D+ and GND) and is used by the chip to know if it's supposed to act as a host:


  An OTG dual role device supports both USB host and device functionality. OTG dual role devices
  use a micro-AB receptacle. This allows a micro-A or a micro-B plug to be attached. Both the
  micro-A and micro-B plugs have an additional pin, the ID pin, to signify which plug type was con-
  nected. The plug type connected to the receptacle determines the default role of the host or
  device. An OTG device will perform the role of a host when a micro-A plug is detected. When a
  micro-B plug is detected, the role of a USB device is performed.
  
  -- PIC32 Manual section 27


Making a fully OTG system though is quite an involved and specialized process, and unless you already know both host and device modes intimately I wouldn't be inclined to attempt it.  Instead I'd separate out the two different roles into separate connections.  Dedicating the USB to the USB Memory device simplifies the code massively.  Routing the PC communications through a USB serial chip, such as an FT232R, PL2303, or MCP2200, for example, means you can then just use the simple UART device to do all PC communications.  Time to market is reduced as you don't have to learn all about USB OTG, and it also gives you the advantage that you can have the USB MSD plugged in at the same time as the PC connection is active.