Finaly, I understand the way to do geocode and reverse geocode with my PostGIS database. I made an stored procedure that finds geometry types that are near a point. This stored procedure uses the distance function to get the nearest points. After that I've created a REST api that calls this stored procedure to resolve the reverse geocoding requests.
Correct me if I'm wrong, but I've understand that Nominatim project creates a webservice api for databases that have been imported from OSM. So you don't have to create any stored procedure for reverse geocoding and geocoding. Also you don't have to make any webservice to resolve the requests through the web.
Hope this helps someone.
CREATE OR REPLACE FUNCTION reverse_geocode (lat double precision, lon double precision)
RETURNS text AS
declare point geometry; rec record; geocode text;
point := geomfromtext('POINT('||lat||' '||lon||')', 4326);
select name, distance(way, point) as dist
into rec from mapserverdb_point
order by dist asc limit 1;
geocode := rec.name;