There are currently a few ways to search for printed music. The first involves learning a text-based representation of music, and using that to query a database of samples, also encoded in a text-based representation. Themefinder is a good example of this.
The second way is to have a piano keyboard, either real or virtual, and ‘play’ in a query using music notation. Typically, this is then converted to a text-based representation (XML or other), and used as a query against a database.