The UK is a net contributor to the EU, but it also has the financial center of the EU in London. On top of that some areas of the UK are net recipients of EU money, others are contributors.
Losing the financial center alone may already tip the balance out of favor, and for some areas (notably Scotland) the loss will be much larger.
Back of the envelope has the UK in worse shape without the EU and access to their market than with.
Regardless of what will happen now, the UK will lose the financial center (it will most likely end up in Frankfurt am Main), Scotland will secede from the UK and will apply (assuming a majority votes for that proposal) to the EU as an independent entity, much like Ireland.
The one thing this referendum has already achieved is that the position of the UK on the world stage is marginalized further.