The smell is from dead bacteria and organic matter that is decomposing.  It creates hydrogen sulfide.
	
	Rinse the sand really really well and I wouldn't put it in an established tank but it can be used in a new tank to cycle.
	
	The potential down side is that the junk may introduce a bunch of nutrients into the tank.
	
	Sand is cheap - I'd toss it and get new.
	
	Jenn