I was working on my other Blogger website today.
If you are using Blogger you can add it by using "Add a Gadget".
But I didn't want to use a Gadget, because I wanted to add a search function in a horizontal navigation.
If you want to add it to your website with using HTML, you can find the details in Google custom search.
So I added search function with the following code to my Blogger site.
<form expr:action='data:blog.homePageUrl + "/search"' id='search_form' method='get'>
<input id='searchinput' name='q' size='22' tabindex='2' type='text' value=''/>
<input id='searchbutton' name='submit' tabindex='5' type='submit' value='Search'/>