Derby were well below the standard they had set in taking 14 points from their previous six Sky Bet Championship games and Bournemouth had chances to punish them but failed to take advantage.
Matt Ritchie was unlucky when he slammed a shot from the edge of the box against a post in the 16th minute and Lewis Grabban drifted into a good position minutes later only to fire wide.
He should have put his side in front in the 27th minute when he spun away from two Derby players on the left and raced into the penalty area but he failed to get any power in his shot and it was a different game in the second half.
McClaren made two substitutions, switched to a 4-4-2 formation and put Bournemouth under pressure which paid off when Martin curled in a 20-yard free-kick in the 85th minute.
"It was a game of two halves and 0-0 at half-time was a great score for us," Derby's head coach admitted.
"They had kind of missed their chance and we knew that and knew we would have ours. We were waiting for that one moment of quality and in the end we got it.
"We took a risk to win the game, other days it won't work but today it did. It depends what kind of team you've got and with this team, we can open it right up, we have the quality in the squad.
"This team is attacking and scores goals and sometimes, you have to let them loose."
Bournemouth boss Eddie Howe said: "We performed really well in the first half and should have been ahead.
"It was more backs to the wall in the second but I thought we defended really well and couldn't see Derby scoring from open play, it was a really good rearguard display.
"We feel hard done by with the goal and how it came about but that's life for us today I'm afraid.
"My immediate reaction was that it wasn't a foul, I thought Tommy (Elphick) took the ball, he's an honest player and his reaction spoke volumes.
"But we created good chances and had good situations we didn't make the most of but the pleasing thing for me today was the never-say-die attitude, the players never gave up, even late into the game when we were trying to get a point.
"If we perform like that, we will be okay."
Derby next take on second-placed Burnley at Turf Moor in seven days' time and McClaren said: "It's a big test for our team, it's about the performance to see how far we've come.
"It will give us a good indication for the rest of the season."