This idiom originated in the early 1800s. It is said that welcome visitors to a house were served a hot meal but someone who was not welcome was given a cold shoulder of whatever meat was being eaten. The shoulder was known to be the coldest and toughest part of the animal and a much inferior meal.

Examples