Countries contribute money to an IMF pool based on a quota system, and countries with a payments imbalance can borrow from the pool.
The World Bank is funded in a similar manner, although the funding is oftemn from repaid loans and the loans are given for more specific projects. The World Bank is a sister organization to the IMF, and works with it.
The Federal Reserve System is the central bank of the United States, and is not involved in direct lending to foreign countries. To the extent that a US bank makes loans overseas, the Fed oversees the reserve levels made on foreign loans.
The Fed is funded by its member banks and through earnings it makes by being a lender to banks. It may also issue notes.