You know, I think this hasn't been answered because no one outside of Riot is exactly sure how it is calculated. I do know that the bulk of the XP/IP is based on win/loss and that it is adjusted based on map and game type (you get less for playing on twisted treeline and for playing practice matches). You also can get bonuses for a quick win or for holding off the opponents in a loss.
What I will say is having a great game personally and losing will never net you as much XP/IP as winning, regardless of your stats. I suspect that XP/IP is strictly based off of W/L and game length, but don't take that as gospel.
Edit: heh, I say no one's answered it after it sits for half a day and get ninja'd by TKana. Well played sir, well played