A cultural reference is when an older, classical work is referred to in a later work of art or popular culture. In the case of Hamlet's speech, "What a piece of work is man," there are many references to it in later works.
In the 1960's rock musical "Hair," Hamlet's speech is quoted word-for-word in a song called (what else?) "What a piece of work is man." (See the second link below.)
In a "Star Trek" episode, a character says:
What Hamlet said with irony I say with conviction:
‘What a piece of work is man! How noble in reason, how infinite in faculties, in form and moving how express and admirable, in action how like an angel, in apprehension how like a god!’
In other words, Hamlet is not really sure how great "a piece of work is man," because he is so confused and depressed; the speaker in Star Trek, however, is convinced that man really is a great "piece of work."
See the first link below for more on this and other cultural references to Hamlet's speech.