The role of the Holy Spirit in the Old Testament was not principally different from the role of the Holy Spirit in the New Testament. While there are some differences, there's an essential unity between the two Testaments.
The Holy Spirit was active in many ways in Old Testament times. First and foremost was the Trinity's part of the work of creation. In the act of creation itself, the Father, the Son, and the Spirit were all involved. The Spirit brooded over the water and brought order and structure out of the yet unordered universe that we find in the opening chapters of Genesis. People were regenerated in the Old Testament just as they are regenerated in the New Testament, and one cannot be regenerated except through the influence of God the Holy Spirit. David needed the regenerating power of God just as much as the apostle Paul needed it in the New Testament.
We also know that the Spirit was very active charismatically; that is, by gifting certain people in the Old Testament and equipping them for specific tasks. For example, the king of Israel was anointed with oil, symbolizing his being anointed by the Holy Spirit to be empowered to carry out his vocation in a godly way. The same was true of priests. The prophets of Israel, who were agents of revelation, were inspired by God the Holy Spirit and equipped to be the messengers of God to the people and to give us sacred Scripture in the same basic manner that the apostles in the New Testament were so endowed and superintended by the Holy Spirit. So we see that the Spirit was active—regenerating, sanctifying, preserving, interceding for—doing all of those things in the Old Testament that he does in the New Testament.
What's the difference? In the Old Testament book of Numbers, when Moses was complaining because the burden of leading all the people had become so weighty it was about to crush him, he pled for relief from God. God told him to gather seventy of the elders of Israel in order to take from the Spirit that was upon Moses and distribute it to the seventy so they could help him lead the people of Israel. That's exactly what the text said happened. God then gave this charismatic empowering, this special gift, to seventy other people, not just Moses, so that they could all participate in ministry. That was not regeneration or sanctification, it was an empowering for ministry given only to select individuals. Moses' prayer was, "Oh, that all the Lord's people were prophets and that the Lord would put His Spirit upon them!" (Num. 11:29). What Moses prayed for became a prophecy in the pen of the prophet Joel, who said that in the latter days that's exactly what would happen. And on the Day of Pentecost it did happen. The apostle Peter said that it was about this that Joel was writing, that now the Spirit to empower the church for ministry is given to everybody, not just to the leaders.