There are various PICs that have various level of motor control hardware built in. At the lowest level you can use just basic PWM generators. At the high end there are some intended for driving 3 half-bridges with programmable dead time and other logic.
Go to the Microchip site and look for the product selector. You can easily get a list of all PICs with various combinations of features, like motor control PWM, some minimum amount of program space, certain size package, etc.
My rule of thumb is that you should consider an operating system if the product requires one or more of the following: a TCP/IP stack (or other complex networking stack), a complex GUI (perhaps one with GUI objects such as windows and events), or a file system.
If you've done some bare metal coding then you're probably familiar with the super-loop program architecture. If the product's firmware requirements are simple enough to be implemented with a super-loop that is maintainable (and hopefully somewhat extensible) then you probably don't need an operating system.
As the software requirements increase, the super-loop gets more complex. When the software requirements are so many that the super-loop becomes too complex or cannot fulfill the real-time requirements of the system then it is time to consider another architecture.
A RTOS architecture allows you to divide the software requirements into tasks. If done properly, this simplifies the implementation of each task. And with task prioritization an RTOS can make it easier to fulfill real-time requirements. An RTOS is not a panacea, however. An RTOS increases the overall system complexity and opens you up to new types of bugs (such as deadlocks). As an alternative to the RTOS you might consider and event-based state machine architecture (such as QP).
If your product has networking, a complex GUI, and a file-system then you might be at the point where you should consider full featured operating systems such as VxWorks, Windows, or Linux. Full featured operating systems will include drivers for the low-level details and allow you to focus on your application.
Best Answer
Look at the MISRA (Motor Industry Software Reliability Association) guidelines for safe C. They were designed specifically for coding in C and C++ for embedded application.
Wikipedia: https://en.wikipedia.org/wiki/MISRA_C
And the MISRA-C home page: http://www.misra-c.com/