Well, that's quite an interesting question. I was reading up on bees to help answer your question and I found some interesting things. Did you know there are over 25,000 different kinds of bees? Most people refer to Honeybees and Bumblebees as bees and that is what I think you are probably referring to.
Honeybees are broken up into three groups: the Queen, worker bees, and the drones. The Queen is the head of the colony and can live up to 4 years. The worker bees are sterile females (they can't have babies) that work to feed the others. The worker bees only live 42-56 days and work themselves to death. The drones are fertile males that mate with the Queen. They only live about 50 days. The male bees do not sting, only the females and the Queen bee sting.
Some people think that bees go out looking for things and people to sting, but that isn't true. A bee will sting for two reasons: to protect its colony and when its frightened. That is why people get stung when they step or sit on bees. When a bee does sting a mammal it dies because the skin on mammals is too thick for the bee to pull its stinger back out. When the stinger is used on a mammal it detaches from the body of the bee, taking with it the venom sac, muscles, and a nerve ganglion control center.
Soon after, the bee who stung will die because the bees organs are torn out in the stinging process. However, a bee can sting other insects and not die because the skin on insects is not as thick as mammals. There are two parts or lancets to the sting itself, each with curved barbs. These parts or lancets are moved alternately by the muscles so that the barbs continue to pull the sting deeper and deeper into the skin once it has been released. There is a valve-and-piston arrangement on the end of the lancets adjacent to the venom sac that causes venom to be pumped into the wound as the lancets move. This causes an alarm pheromone to be emitted from the base of the sting that attracts other bees and has been shown to increase their aggression.
This may be a bit confusing, but let me give you a comparison to help clarify. If you were to look at a straightened fish hook, the triangular point on the hook is much like that of a barbed stinger. If you were to try to stick the fish hook through leather, it would be very thick and hard to remove. That is how it is for a bee when it stings mammals. If you were to stick the fish hook in an apple, it would go in and out quite easily. This is how it is when a bee stings another insect and that is why they do not die.
If a bee stings you there are some things you should know. Only about 1 in 100 people are actually allergic to bee stings, but it can be a serious thing. If you begin to have an allergic reaction, seek professional help. Do not pinch out the stinger because that squeezes more venom into your body. Try to find a credit card or other flat utensil to scrape the stinger out. It is very important to remove the stinger because the venom sacs can pump venom for up to 10 minutes after the bee has released its stinger.
I hope this helps answer your question!