I'm assuming it's a laptop, else you get could a new keyboard(?), not much I'd estimate... If you still have a receipt you could get a free repair from whatever store.
You all are wrong. Im a tech at bestbuy I replaced a spacebar for a customer a few days ago. The total cost 24.08... because we had to order out for the space bar replacement... the labor was 15$ lol
Anyways, if you were to take it to get repaired professionally they would probably order a whole new keyboard (or claim to) and it would probably be like $30 - $40.
Unless it is really obvious that you just need to reattach it then it may be cheap, maybe even free if you take it to the right place.