Early 2009 iMac upgrading to Bluetooth 4.0
Register as an Apple Developer for free with your Apple ID, search for Bluetooth Explorer on this page.
After you installed the app you can plug in your Bluetooth dongle and open the app. Press CMD + L and pick your Bluetooth dongle from the list. Reboot your Mac and you're good to go..

This worked for me, I'm using a 2010 iMac with a Trust Bluetooth 4.0 dongle (both Mavericks and Yosemite).