In Freud's book The Interpretation of Dreams, he uses what he calls "The Dream of Irma's Injection" as an example of one of his own dreams which helped him arrive at what he considered the explanation of the meaning of dreams. Freud spent many years analyzing his own dreams, in addition to the dreams of some of his patients, before he achieved what he regarded as this great breakthrough in understanding dreams and acquiring a key to understanding the unconscious. "Irma" was a pseudonym for one of his patients.
According to the article in Wikipedia:
Freud came to a conclusion about the meaning and intention of the dream using his analysis. He believed that the dream fulfilled several wishes and that it represented a particular situation that he might have wished to exist in. Freud concluded that the motive of the dream was a wish and the content of the dream was a wish fulfillment. Freud eventually concluded that all dreams represent some sort of wish fulfillment.
Freud's belief that all dreams are wish fulfillments, most of which are heavily disguised for one reason or another, often because they are expressions of repressed sexual desires, was the foundation of all his work with his own and his patients' dreams. His interest in dreams was inspired by his belief that many physical ailments originate in the unconscious.
This was given to what he dreamt on July 23, 1895. After he analyzed his historic dream, he arrived at his theory that dreams are wish fulfillments. He wrote down his dream immediately after he woke up and thus still had a clear image of what happened. He saw close signs to what his daughter suffered and upcoming events and came to a theory that his dream fulfilled several wishes.