Freud has a book on jokes called "The Joke and Its Relation to the Unconscious" which I thought was pretty interesting (although I mostly read the first section which analyzed the technique of the joke and the tendencies of the joke.)