I'd say there isn't a difference in the meaning but what you emphasize is obviously different when you change the word order.
"It is useful to plant trees." Here's the emphasis is on the adjective "useful"
"Planting trees is useful." Here you emphasize the action instead.