This Mac OS Spotlight plugin queries Google and displays the search results in Spotlight:
http://www.apple.com/downloads/macosx/spotlight/googleimporter.html
I understand how to make custom metadata importers. (I'd post a link but I'm not allowed to. Google "Create Spotlight Plugin" and go to first link.)
That's not really what I want to do though.
Let's say I want to create one for Yahoo - how would that work? How do you have Spotlight send your program the query string, and display results you return to it? And in what format do you return results?