First of all the word ונתתי means "I will give you" in this case as it is the waw-consecutive form. One should read this passage alongside Ezekiel 34, which discusses "shepherds" in a very similar manner. Shepherds is used as a metaphor for kings or rulers in both of these passages. As for the word רעים כלבי, that means "shepherds who will do what I want them to do," as כלבי often means "like my hearts desire." In context, this verse means that if the people repent from their ways they will be given good leaders. It is a more abstract statement. As for some leaders who would fit this statement, some examples are Ezra and Zerubbabel.
Wanatathi should not be translated "and I gave" but "I would [or will give -- when you satisfy what I've described] give."
The shepherds who are of the sort God desires (which are kelabu - "according to [God's] heart") are those which are promised to the wayward people, when and if they repent ("return" to God's ways).
The context is that the people have lost their way and need good leaders -- but don't deserve them because of their waywardness. If they make an effort to return to the way they know is right, God will give them good leaders to nourish them in that journey of good will.