if it is OEM its illegal to sell to someone else without selling the computer it was first installed on. if its retail, i think you can reinstall it on up to three computers provided its removed from the previous one first (i think)
So long as it was removed from the first computer, yes you can resell it. In a case like this though it's tricky to verify that it was actually removed, some say it's up to the Seller, others the Buyer. You may or may not need to include hardware with it - been a while since I've re-sold software. I think that unless the software specifically says you need to include something (or does Ebay still insist on it by default?) you can just sell it.