can anyone give me the code for accessing data in usb using arduino and usb host shield???
Depends completely on what type of device you are talking to.
If it's something that makes sense to do and the USB device is common, someone has probably done it, and google would be your first stop for seeing if anyone has written code for the Arduino to access it - search for "Arduino usb host " and whatever type of device you're trying to access.
The code will be different for each device.
If you need to move large amounts of data, Arduino is not an appropriate platform.
If you need to log data, and are planning to use a USB flash drive to store it, use an SD card instead. Much cheaper, much easier to interact with from an Arduino, because you don't need the host shield.