There are lots of govt. approved money exchange companies at Dhaka city, mostly at Matijheel, Fakirapool, Dilkusha, and Gulshan area from where foreigners can purchase USD in exchange of Tk.
It is not possible to purchase USD from any bank for a foreigner unless they can prove that they have exchanged the dollars to taka from their bank earlier on. This applies to only tourists and volunteers. As an expat, if you’ve paid in USD to a Bangladeshi foreign currency bank account, you are allowed to withdraw that dollar amount without limitations but only when you can prove you are leaving the country.
Some people reported of being success with waiters at high end hotels willing to exchange USD out of Tk. that they had received in tips. Worth a try.
Also you can give a call to the US embassy. May be they can suggest you some place to get USD. But be extremely careful about any unauthorized person in exchanging currency. Recently some case has been reported about making false USD here. You can be easily cheated.