Acknowledge funding institute, sending and hosting universities
I think that you should distinguish acknowledgements from affiliation.  You should also generally act generously with acknowledgements, because giving acknowledgements doesn't generally detract from anything as long as you're honest about them.

So, in your case:


Your affiliation is University A.  If you are at University D by the time the paper hits camera-ready, then you might add that affiliation too, as a dual affiliation.
You definitely need to acknowledge the funding support of Institute C.  You may also want to acknowledge University B if the organization has given you support (as opposed to just individual faculty members).  For example, if the department loaned you facilities for doing your work, that would definitely merit acknowledgement in my book.
Other people who helped significantly with the project (except within normal non-scientific job duties) should get co-authorship or acknowledgement.  Thus, a hosting faculty member at University B should appear in the paper, but the IT person at University B who fixed your computer would not.