Can someone put some PWM motor control samples in the IDE?

A motor need not be driven by a shield. However, as stated, it is better that example software is maintained by the vendor.

As you have noted, example software should be succinct and lend itself to experimentation.
It should also make pitfalls clear. In this case, not applying both forward and backward signals at the same time.

Hardware can overcome this problem allowing one line to select direction, the other control speed. This might be done via TTL/CMOS logic (integrated drivers, or using discreet components - the latter being a better way to learn) or a neat solution is to use a hybrid H-Bridge made of a DPDT (or two DPST) relay and a FET. An advantage of using relays is that they (tend) to be break-before-make, reducing the need to manage timing between applying back or forward signals. The positive leg of the relay H-Bridge is supplied via a FET to manage the PWM signal. Selection of the relay contact material is important, and often whetted or self-cleaning types may be advantageous.

Slightly off topic - have you noticed that some sealed relays have a little pip on them, usually in the corner? This is to improve shelf-life [edit] and to protect the contacts during manufacture [/edit], this pip should be broken open when in service to improve contact life.

Back EMF Breaking [BEMFB] may be required. BEMFB usually requires a further control line (although simple BEMFB can be implemented with two lines), and can be extremely violent! For this reason, PWM may be used to manage the motor shunt (short circuit).

As you can see, bi-directional motor control can range from crude, full speed fore & aft, right the way through to variable speed control and braking control. The more you invest in control logic, the easier it is to control safely.