You can do, but its costly
(assuming you are already wielding the weapon in question with one hand)
Standard Action: Remove Shield
As BESW pointed out
Rules Compendium page 267: "To use a shield, a creature must strap it to the forearm. Doing so is a standard action unless otherwise noted. Removing a shield is also a standard action."
Free action: Wield your longsword with two hands instead of one.
As per Wizards FAQs page for 4e:
I wield a longsword. When I change from one hand to two (or vice versa), what type of action is that?
Changing the number of hands you are using to hold a weapon can be done as a free action."
Granted the customer FAQs are not on the same level as the Compendium, but everyone I've ever played with has played it this way and the Char Op Boards on Wizards also tend to suggest this is a-ok per the rules.
So perks to this is that your shield is stowed vs. on the floor since removing it and then dropping it is stupid when it takes the same action economy to simply stow the shield.
Alternatives
Assuming you are using a light shield, you can get a +1 bonus to AC (But not to reflex as with a light shield) by wielding a defensive weapon in your off-hand. Now a normal defensive weapon like a parrying dagger would take up your hand completely not letting you benefit from the two-handed wield of the versatile weapon. However, the Gauntlet Axe lets you keep your hand free:
This heavy bracer holds two light crescent blades, turning the forearm into an axe while keeping the hand free. The weapon can also serve as a light shield. A gauntlet axe can be enchanted as either an arms slot item or as a magic weapon. When enchanted as a magic weapon, it does not occupy a character’s arms slot.
Thus:
Free Action: Wield longsword two handed (gauntlet axe is not a weapon and you don't gain the defensive property while doing this)
Attack
Free Action: Wield Longsword one handed (gauntlet axe functions as another weapon and you regain the defensive property).