The Honey Bee, as RD pointed out, has a stinger which continues to pulsate after it has detached from the body. This is only the case in the Honey Bee in which the stinger is a modified ovipositor. The stinger is barbed, so once it pierces the skin, it cannot be retracted. Wasps and other bees do not have a barbed stinger so they are capable of multiple stings.
But I think the question here is more on the capability of a wasp or bee being able to deliver a sting after it has died. This is not possible since the animal is dead and, therefore, not conscious. However, the sting delivery mechanism may still be able to deliver a sting due to the mechanism continuing to pulsate post mortem, in the same way as muscles may continue to twitch in other animals after life has expired. The sting can thereby be delivered if the stinger enters the skin.
The usual case is that a dead bee or wasp tends to still trigger a reaction in us. A frantic brushing off of the dead insect or the pressure/movement of our clothing against our skin with a dead insect trapped within may cause the stinger to penetrate the skin. Even if the stinger is no longer active, pressure put on the dead body can have the same effect as the live pulse used to deliver a sting. While in the case of a honey bee, should the barbed stinger be pushed into the skin, it can continue to pulsate, delivering the venom, in the normal way.
So I would say the answer to the question is no, dead bees and wasps do not sting, but our actions may cause the stinger to be pushed into the skin and venom delivered by that same action in a way similar to the use of a hypodermic needle. It is not the insect which stings us, but rather that we inject ourselves with the dead insect.