You start with downloading the driver for it
here. I think the most appropriate example in the driver is the one called HP34970A Scanner Demo. I haven't used that specific one very much but you should be able to easily modify it to save measurement results to a file.