This is a question that literature students have grappled with for a long time. There is enough evidence to argue either way, so it comes down to the personal opinion of the student at the end of the day. On the one hand, Shylock certainly seems like a villain. He deliberately pursues vengeance, hoping to kill Antonio by claiming his pound of flesh and therefore becoming a hero of Judaism against his Christian persecutor. He pursues this hope to the very end of the court scene, ignoring Portia's eloquent words counselling mercy, and in this sense he is judged in the same way that he would judge others. He says that he would rather have his wealth back than his daughter, even going as far as to say that he would rather have his daughter dead and his wealth back. Even parts of his speech that are designed to evoke sympathy, such as Shylock's famous "Hath not a Jew eyes?" speech, really seeks to justify his own barbarity in claimining his pound of flesh. All of these points strongly suggest that Shylock is more of a villain than a victim.
However, at the same time, the reader is struck by the way that Shylock has been used and abused by those around him. Antonio spat in his face and insulted him and is quite open about his hatred of Shylock to his face. His eventual fate, in being forced to see all of his wealth go to a gentile and having to abandon his beloved faith and become a Christian, strikes the audience as being cruel beyond measure. The treatment he receives at the hands of his daughter, Jessica, who steals her fathers wealth only to squander it, adds insult to injury. Note what Shylock says in response to Tubal's news that Jessica has exchanged a ring for a monkey in Act III scene 1:
...it was my turquoise, I had it of Leah when I was a bachelor: I would not have given it for a wilderness of monkeys.
Jessica has deliberately taken an object that she knows is of inestimable value to her father, because it was a gift from her mother, and exchanged it for a monkey, insulting both her father and her mother's memory. These points strongly suggest that Shylock is a villain. Both sides can easily be argued, but as always with such questions, it is important that any answers are fully supported with textual reference and that both sides of the question are considered.
One might add that the play is replete with duos and trios. The play begins with Antonio speaking with Solanio and Salerio(some editors prefer Salarino): "In sooth.......And such a want-wit sadness makes of me....." The phrase "want-wit" means "one lacking in good sense"(Bevington, Bantam edition, 1988). Solanio later refers to Shylock with the term "villain"(2.8). Later still, Solanio says, "I am sure the duke / Will never grant this forfeiture to hold"(3.3), which proves true. In act 3, scene 1, Salerio and Solanio speak with Shylock. Salerio says: "Why, I am sure if he forfeit, thou wilt not take his flesh. What's that good for?" He therefore does not regard Shylock as a villain. He is, however, concerned that Shylock has, like Antonio, become a "want-wit." Shylock's "I am not well"(4.1.408 or so) echoes Gratiano's "You look not well"(1.1.75 or so), spoken to Antonio. Therefore, one might regard Antonio and Shylock as co-comic villains.