A huge blast in Pakistan has killed at least thirty and injured hundreds after gunmen attack police and intelligence offices.